<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">

    <h:form id="arqRetornoBBForm" enctype="multipart/form-data" >

        <rich:panel>
            <f:facet name="header">arqRetornoBB</f:facet>

            <s:decorate id="fileUploadDecoration2" template="/layout/edit.xhtml">
					<ui:define name="label">Arquivo retorno Banco do Brasil</ui:define>
					<s:fileUpload id="file2" 
						      data="#{arqRetornoBB.retornoBB.data}"
						      contentType="#{arqRetornoBB.retornoBB.contentType}"
						      fileName="#{arqRetornoBB.retornoBB.nome}"
						      fileSize="#{arqRetornoBB.retornoBB.size}"
						      value="Selecione um arquivo" />
			</s:decorate>
				

            <div style="clear:both"/>

        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="arqRetornoBB" value="Processar Arquivo"
                    action="#{arqRetornoBB.enviar}"/>
            <h:commandButton id="arqRetornoBBMail" value="Enviar E-Mail"
                    action="#{arqRetornoBB.enviarMail}"/>

        </div>

    </h:form>

    <rich:panel id="painelResultado">
        <f:facet name="header">Listagem de Candidatos do Lote</f:facet>
        <strong><h:outputText value="Total: #{candidatosAtualizados.size()}" rendered="#{ not empty candidatosAtualizados}"/></strong>

        <div class="results">


            <rich:dataTable id="candidatosList" var="_candidato"
                      value="#{candidatosAtualizados}"
                   rendered="#{not empty candidatosAtualizados}">
                <h:column>
                    <f:facet name="header">Nome</f:facet>
                    #{_candidato.nome}
                </h:column>
                <h:column>
                    <f:facet name="header">CPF</f:facet>
                    #{_candidato.cpf}
                </h:column>
                <h:column>
                    <f:facet name="header">Data Nascimento</f:facet>
                    <h:outputText value="#{_candidato.dataNascimentoFormatada}" />
                </h:column>
                <h:column>
                    <f:facet name="header">Valor Pago</f:facet>
                    <h:outputText value="#{_candidato.valorPago}"  >
                    	<f:convertNumber maxFractionDigits="2" maxIntegerDigits="3"/>
                    </h:outputText>
                </h:column>
                <h:column>
                    <f:facet name="header">Status Pagamento</f:facet>
	                <h:outputText id="statusPagamentoAPGId" value="#{messages.aguardandoPago}" rendered="#{_candidato.statusPagamento eq 'APG'}"/>
	                <h:outputText id="statusPagamentoISTId" value="#{messages.isento}" rendered="#{_candidato.statusPagamento eq 'IST'}"/>
	                <h:outputText id="statusPagamentoPGId" value="#{messages.pago}" rendered="#{_candidato.statusPagamento eq 'PG'}"/>
	                <h:outputText id="statusPagamentoNPGId" value="#{messages.naoPago}" rendered="#{_candidato.statusPagamento eq 'NPG'}"/>
	                <h:outputText id="statusPagamentoDESId" value="#{messages.aguardandoPagoDesconto}" rendered="#{_candidato.statusPagamento eq 'DES'}"/>
	                <h:outputText id="statusPagamentoPGDId" value="#{messages.pagoComDesconto}" rendered="#{_candidato.statusPagamento eq 'PGD'}"/>
                </h:column>
            </rich:dataTable>

        </div>

    </rich:panel>



</ui:define>

</ui:composition>
